package com.subway.service.Impl;

import com.subway.dao.Impl.SubWayDaoImpl;
import com.subway.dao.SubWayDao;
import com.subway.entity.SubWayInfo;
import com.subway.service.SubWayService;

import java.util.List;

/**
 * 地铁信息业务实现类
 */
public class SubWayServiceimpl implements SubWayService {
    private SubWayDao subWayDao = new SubWayDaoImpl();
    @Override
    public boolean add(SubWayInfo subWayInfo) {
        return subWayDao.add(subWayInfo)==1 ? true : false;
    }

    @Override
    public boolean del(int id) {
        return subWayDao.delete(id)==1 ? true : false;
    }

    @Override
    public boolean modify(SubWayInfo subWayInfo) {
        return subWayDao.update(subWayInfo)==1 ? true : false;
    }

    @Override
    public SubWayInfo getSubWayInfoById(int id) {
        return subWayDao.getSubWayInfoById(id);
    }

    @Override
    public List<SubWayInfo> list() {
        return subWayDao.list();
    }
}
